/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Bus_合同派工搜集信息",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Order.IServices;
using VOL.Core.Utilities;
using Mapster;
using Newtonsoft.Json;

namespace VOL.Order.Controllers
{
    public partial class Bus_合同派工搜集信息Controller
    {
        private readonly IBus_合同派工搜集信息Service _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public Bus_合同派工搜集信息Controller(
            IBus_合同派工搜集信息Service service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }

        [Route("Bus合同派工搜集信息")]
        [HttpPost]
        public ActionResult Bus合同派工搜集信息([FromBody]Bus_合同派工搜集信息 bus合同派工搜集信息)
        {
            VOL.Core.Services.Logger.Info("查询-Bus合同派工搜集信息开始"+JsonConvert.SerializeObject(bus合同派工搜集信息));
            WebResponseContent webResponse = new WebResponseContent();
            string message = "";
            List<Bus_合同派工搜集信息> a = _service.Bus合同派工搜集信息(bus合同派工搜集信息.合同分拆guid.GetValueOrDefault(), ref message);
            if (a != null && a.Count > 0)
            {
                webResponse.OK(message, a);
            }
            else
            {
                message = "未查询到合同派工搜集信息";
                webResponse.Error(message);
            }
            VOL.Core.Services.Logger.Info("查询-Bus合同派工搜集信息结束" + JsonConvert.SerializeObject(webResponse));
            return Json(webResponse);
        }
    }
}
